home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
mebbs
/
mnl010.lha
/
MN.L010
< prev
next >
Wrap
Text File
|
1994-11-24
|
17KB
|
548 lines
/*
Name: MN.L010
Purpose: Create MEBBSNet Call Log
Author: R Pope
Date Written: 02-Aug-90 v1.00
Revised: 05-Aug-90 v1.01 Calculation Error on Time Used
08-Aug-90 v1.02 Error when Limit Exceeded
11-Aug-90 v1.03 Run from Ram Copy of Log
13-Aug-90 v1.10 Add Daily Totals
15-Aug-90 v1.20 Added ParagonX.Log file trimming
17-Aug-90 v1.21 Page Break on Date Break
19-Aug-90 v1.22 More Error Information
19-Aug-90 v1.23 Correct Post-Download Disconnect being
treated as having left a message
01-Sep-90 v1.24 Description of uploaded file treated as
a download. Corrected.
18-Nov-90 v1.30 Added FidoNet sessions
03-Dec-90 v1.31 Added ~vp to correct for v2.08r change
27-Dec-90 v1.32 1. LoTek transfers added to Fido
2. Fido transfers included in stats
18-Sep-91 v1.33 Conversion for HiSoft compiler
07-Oct-91 v2.00 Converted to ARexx
20-Oct-91 v2.01 Line noise entries handled
13-Nov-91 v2.02 Fidonet entries lost during ARexx conv
21-Nov-91 v2.10 Line # added
17-Dec-91 v3.00 Converted to StarNet; ANSI added
04-Jan-92 v3.01 "/" in name converted to "-"
Changed to one trimfile per node
21-Nov-92 v3.02 Modified to handle 5-character baud rates
12-Dec-93 v4.00 Converted to MEBBSNet
23-Nov-94 v4.10 Converted for MEBBSNet v0.160
FILES: MEBBSNet Log File(s)
Ram Copy of MEBBSNet Log File(s)
MEBBSNet configuration file
Caller Log File
Config File
*/
pgmver = 'MN.L010 v4.10 23-Nov-94'
say pgmver||' by Dick Pope'
conpath = 'MEBBSNet:MEBBSNet.con'
call readcon
trimpath = mainpath||'s/TrimFl'
cfgpath = mainpath||'ConfigFiles/mn.l010.cfg'
parse arg altcfg
if altcfg ~= '' then cfgpath = altcfg
call config
mainpath = 'dwn:rexx/'
months = ':Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec:'
hdr = ' Date On Off Name Ln Baud Used U/L D/L Msg'
red = '
'
green = '
'
yellow = '
'
pink = '
'
ltblue = '
'
white = '
'
hapos = d2c(39)
bl = ' '
call clrcall
call clrtot
open('clg','ram:calllog.txt','w')
do nn = 1 to numnodes
linenum = nn
limit.nn = 0
hi.nn = 0
curnode = substr(nodes,nn,1)
address command 'copy ' mainpath||'MEBBSNet'||curnode||'.log ram:logfile'
open('stl','ram:logfile','r')
stldata = readln('stl')
do while eof('stl') = 0
hi.nn = hi.nn + 1
if left(stldata,1) = '|' then do
parse var stldata intype indate intime indata
intype = strip(intype,'b')
indate = strip(indate,'b')
intime = strip(intime,'b')
indata = strip(indata,'b')
if length(indate) ~= 9 then do
indate = left(indate,4)||'0'||substr(indate,5)
end
tmp = (pos(left(indate,3),months) + 2) / 4
if length(tmp) = 1 then tmp = '0'||tmp
compdate = '19'||substr(indate,8,2)||tmp||substr(indate,5,2)
dayoff = date('b',compdate,'s')
z = upper(indata)
intype = 'detail'
if pos('OPERATIONAL',z) > 0 then intype = 'header'
if pos('STARTING MAIL-ONLY EVENT',z) > 0 then intype = 'header'
if pos('EVENT CHANGE',z) > 0 then intype = 'header'
if pos('WAZOO:',z) > 0 then do
intype = 'connect'
incall = 'wazoo'
end
if pos('EMSI CONNECT',z) > 0 then do
intype = 'connect'
incall = 'emsi'
end
if pos('NORM. LOGON: USER',z) > 0 then do
intype = 'connect'
incall = 'normal'
end
if pos('NEW USER: USER',z) > 0 then do
intype = 'connect'
incall = 'normal'
end
if pos('ENTERED BBS LOCALLY',z) > 0 then do
intype = 'connect'
incall = 'normal'
end
if pos('BAUD CONNECTION',z) > 0 then do
intype = 'connect'
incall = 'normal'
end
if upper(indata) = 'LOGOFF' then intype = 'off'
if dayoff >= dateset.nn then do
if limit.nn = 0 then limit.nn = hi.nn
if incall = 'wazoo' then call wazoo
if incall = 'emsi' then call emsi
if intype = 'header' then call header
if intype = 'detail' then call detail
if intype = 'off' then call endcall
if intype = 'connect' then call connect
end
end
stldata = readln('stl')
end
close('stl')
end
address command 'delete ram:logfile quiet'
endfl = 'Y'
call newcall
close('clg')
address command 'sort ram:calllog.txt ram:calllog.srt'
address command 'delete ram:calllog.txt quiet'
call logprt
address command 'delete ram:calllog.srt quiet'
if trim = 'Y' then call trimfile
exit 0
/*
***********************************************************************
*** Connect
***********************************************************************
*/
connect:
if pos('BAUD CONNECTION',upper(indata)) > 0 then do
call newcall
end
psn = pos('line ',indata)
if psn > 0 then do
hln = '1'
if psn > 0 then do
hln = substr(indata,psn+5)
psn = pos('.',hln)
if psn > 0 then hln = left(hln,psn-1)
end
end
if pos('baud',indata) > 0 then do
psn = pos('/',indata)
if psn = 0 then do
psn = pos(' ',indata)
hbaud = left(indata,psn-1)
end
if psn ~= 0 then hbaud = left(indata,psn-1)
end
hon = intime
hdate = indate
if incall = 'normal' then do
psn = pos(' USER ',upper(indata))
if psn > 0 then do
psn = pos(hapos,indata)
if psn > 0 then hname = substr(indata,psn+1)
psn = pos(hapos,hname)
if psn > 0 then hname = left(hname,psn-1)
end
end
return
/*
***********************************************************************
*** Scan Header
***********************************************************************
*/
header:
call endcall
return
/*
***********************************************************************
*** Scan detail
***********************************************************************
*/
detail:
if pos('LEFT FEEDBACK',z) > 0 then hmsg = hmsg + 1
if pos('LEFT E-MAIL',z) > 0 then hmsg = hmsg + 1
if pos('POSTED ',z) > 0 then hmsg = hmsg + 1
if pos('MATRIX MAIL',z) > 0 then hmsg = hmsg + 1
if pos(' DL ',z) > 0 then hdl = hdl + 1
if pos(' DOWNLOAD ',z) > 0 then hdl = hdl + 1
if pos(' DOWNLOADED ',z) > 0 then hdl = hdl + 1
if pos('X-SEND ',z) > 0 then hdl = hdl + 1
if pos('Z-SEND ',z) > 0 then hdl = hdl + 1
if pos('SENDING MAIL TO ',z) > 0 then hdl = hdl + 1
if pos('UPLOAD',z) > 0 then hul = hul + 1
if pos('X-REC ',z) > 0 then hul = hul + 1
if pos('Z-REC ',z) > 0 then hul = hul + 1
if pos('LOGGED OUT',z) > 0 then hnote = 'Normal'
if pos('POST-DOWNLOAD',z) > 0 then hnote = 'Normal'
if pos('TIME LIMIT',z) > 0 then hnote = 'Time'
if pos('IDLED',z) > 0 then hnote = 'Sleep'
if pos('LOST CARRIER',z) > 0 then hnote = 'Carrier'
if pos('ZEDZAP',z) > 0 then hnote = 'Normal'
hoff = intime
return
/*
***********************************************************************
*** Logoff Routine
***********************************************************************
*/
endcall:
/*
call newcall
*/
return
/*
***********************************************************************
*** Wazoo Routine
***********************************************************************
*/
wazoo:
intype = ''
if hon = '' then do
hon = intime
hdate = indate
end
if pos('WaZoo:',indata) > 0 then do
parse var indata ind01 ind02
hname = strip(ind02,'b')
end
if pos('Z-Send',indata) > 0 then hdl = hdl + 1
if pos('received',indata) > 0 then hul = hul + 1
hoff = intime
return
/*
***********************************************************************
*** EMSI Routine
***********************************************************************
*/
emsi:
intype = ''
if hon = '' then do
hon = intime
hdate = indate
end
if pos('System:',indata) > 0 then do
parse var indata ind01 ind02
hname = strip(ind02,'b')
end
if pos('Z-Send',indata) > 0 then hdl = hdl + 1
if pos('received',indata) > 0 then hul = hul + 1
hoff = intime
return
/*
***********************************************************************
*** New Call
***********************************************************************
*/
newcall:
hname = strip(hname,'b')
if hname ~= '' then do
if upper(strip(hnote,'b')) = 'NORMAL' then hnote = ''
a1 = left(hname||' ',18)
a2 = left(hdate||' ',9)
a3 = left(hon||' ',5)
a4 = left(hoff||' ',5)
a5 = right(' '||hdl,3)
a6 = right(' '||hul,3)
a7 = right(' '||hmsg,3)
a8 = right(' '||hbaud,5)
a9 = right(' '||hln,1)
a10 = left(hnote||' ',7)
call timecalc
tmp = a2||'~'||a3||'~'||a4||'~'||a1||'~'||a9||'~'||a8||'~'||a11||'~'
tmp = tmp||a6||'~'||a5||'~'||a7||'~'||a10||'~'
tmp1 = (pos(left(hdate,3),months) + 2) / 4
if length(tmp1) = 1 then tmp1 = '0'||tmp1
tmp1 = 99 - tmp1
tmp2 = 99 - substr(hdate,5,2)
tmp3 = 99 - substr(hdate,8,2)
compdate = tmp3||tmp1||tmp2
tmp1 = 99 - left(hon,2)
tmp2 = 99 - substr(hon,4,2)
comptime = tmp1||tmp2
tmp = compdate||comptime||'~'||tmp
writeln('clg',tmp)
end
call clrcall
return
/*
***********************************************************************
*** Time Calculation Routine
***********************************************************************
*/
timecalc:
hon = strip(hon,'b')
hoff = strip(hoff,'b')
if hon = '' then hon = '00:00'
if hoff = '' then hoff = '00:00'
parse var hon hon1 ':' hon2
parse var hoff hoff1 ':' hoff2
hon0 = 60 * hon1 + hon2
hoff0 = 60 * hoff1 + hoff2
if hoff0 < hon0 then hoff0 = hoff0 + 1440
hdiff0 = hoff0 - hon0
hdiff1 = hdiff0 / 60
if pos('.',hdiff1) = 0 then hdiff1 = hdiff1||'.00'
hdiff1 = trunc(hdiff1)
hdiff2 = hdiff0 - 60 * hdiff1
hdiff1 = right('00'||hdiff1,2)
hdiff2 = right('00'||hdiff2,2)
a11 = hdiff1||':'||hdiff2
return
/*
***********************************************************************
*** Clear Caller Values
***********************************************************************
*/
clrcall:
hdate = ''
hon = ''
hoff = ''
hname = ''
hln = ''
hbaud = ''
hul = 0
hdl = 0
hmsg = 0
hnote = ''
incall = 'normal'
return
/*
***********************************************************************
*** Clear Totals
***********************************************************************
*/
clrtot:
htotcalls = 0
htotul = 0
htotdl = 0
htotmsg = 0
htottime = 0
return
/*
***********************************************************************
*** Write Log
***********************************************************************
*/
logprt:
ln = 0
prvdt = ''
open('cls','ram:calllog.srt','r')
open('clr',calllog,'w')
if gfx = 'Y' then do
open('clrA',calllogA,'w')
writeln('clrA','
')
end
clrdata = readln('cls')
do while eof('cls') = 0
parse var clrdata tmp '~' a2 '~' a3 '~' a4 '~' a1 '~' a11 '~' a9 '~' a5 '~' a7 '~' a6 '~' a8 '~' a10 '~'
clrdata1 = green||a2||' '||ltblue||a3||' '||red||a4||' '||green||a1
clrdata1 = clrdata1||' '||ltblue||a11||' '||red||a9||' '||white||a5
clrdata1 = clrdata1||' 'pink||a7||' '||a6||' '||a8||' '||white||a10
if a1 ~= '' then do
if ln / 20 = trunc(ln / 20) then do
if ln ~= 0 then writeln('clr','~vc')
writeln('clr',hdr)
if gfx = 'Y' then do
if ln ~= 0 then writeln('clrA','~vc')
writeln('clrA',white||hdr)
end
end
if prvdt ~= a2 then call datebrk
do while pos('~',clrdata) > 0
psn = pos('~',clrdata)
clrdata = left(clrdata,psn-1)||' '||substr(clrdata,psn+1)
end
clrdata = substr(clrdata,11)
writeln('clr',clrdata)
if gfx = 'Y' then do
writeln('clrA',clrdata1)
end
t1 = left(a5,2)
t2= substr(a5,4)
ln = ln + 1
totc = totc + 1
totd = totd + a6
totm = totm + a8
tott = tott + 60 * t1 + t2
totu = totu + a7
prvdt = a2
end
clrdata = readln('cls')
end
prvdt = 'xxxxxxxxx'
call datebrk
close('cls')
close('clr')
if gfx = 'Y' then do
close ('clrA')
end
return
/*
***********************************************************************
*** Daily Totals
***********************************************************************
*/
datebrk:
if prvdt ~= '' then do
t1 = trunc(tott / 60)
t2 = tott - 60 * t1
tmp1 = right('00'||strip(t1),2)
tmp2 = right('00'||strip(t2),2)
tmp = tmp1||':'||tmp2
totc = right(bl||totc,3)
work = 'Calls: '||totc
totu = right(bl||totu,3)
totd = right(bl||totd,3)
totm = right(bl||totm,3)
work = left(bl,22)||work||left(bl,17)
work = work||tmp||' '||totu||' '||totd||' '||totm
work1 = left(bl,22)||white||'Calls: '||green||totc||left(bl,17)
work1 = work1||white||tmp||' '||pink||totu||' '||totd||' '||totm
writeln('clr',work)
if prvdt = 'xxxxxxxxx' then do
writeln('clr','')
writeln('clr',pgmver)
end
writeln('clr','~vc')
if prvdt ~= 'xxxxxxxxx' then writeln('clr',hdr)
if gfx = 'Y' then do
writeln('clrA',work1)
if prvdt = 'xxxxxxxxx' then do
writeln('clrA','')
writeln('clrA',ltblue||pgmver)
end
writeln('clrA','~vc')
if prvdt ~= 'xxxxxxxxx' then writeln('clrA',white||hdr)
end
ln = 0
end
totc = 0
totd = 0
totm = 0
tott = 0
totu = 0
return
/*
**********************************************************************
***** Read MEBBSNet Configuration File
**********************************************************************
*/
readcon:
open('con',conpath,'r')
condata = readch('con',60000)
close('con')
tmp = left(condata,64)
psn = pos('00'x,tmp)
mainpath = left(tmp,psn-1)
tmp = substr(condata,50881,64)
psn = pos('00'x,tmp)
txtpath = left(tmp,psn-1)
condata = ''
return
/*
**********************************************************************
*** Create Script to Trim Log File
**********************************************************************
*/
trimfile:
do i=1 to numnodes
curnode = substr(nodes,i,1)
open('trm',trimpath||curnode||'.scr','w')
writeln('trm','.key noname')
writeln('trm','.bra {')
writeln('trm','.ket }')
if limit.i > 1 then do
diff = hi.i - limit.i + 1
work = 'trimfile '||mainpath||'MEBBSNet'||curnode||'.log -'||diff
writeln('trm',work)
end
close('trm')
end
return
/*
***********************************************************************
*** Read Config File
***********************************************************************
*/
config:
nodes = '1'
do i = 1 to 10
limit.i = 10
end
calllog = txtpath||'Caller.txt'
calllogA = txtpath||'Caller.gr1'
trim = 'NO'
gfx = 'N'
open('cfg',cfgpath,'r')
cfgdata = readln('cfg')
do while eof('cfg') = 0
psn = pos('=',cfgdata)
cf1 = left(cfgdata,psn-1)
cf2 = substr(cfgdata,psn+1)
if upper(cf1) = 'NODES' then nodes = cf2
if upper(cf1) = 'FILE' then do
clog = cf2
psn = pos('.',clog)
if psn ~= 0 then clog = left(clog,psn-1)
calllog = clog||'.txt'
calllogA = clog||'.gr1'
end
if upper(cf1) = 'LIMIT' then limit = cf2
if upper(cf1) = 'TRIM' then trim = upper(cf2)||'N'
if upper(cf1) = 'GRAPHICS' then gfx = upper(cf2)||'N'
if upper(cf1) = 'NODES' then do
nodes = cf2
nodes = strip(nodes,'b')
if nodes = '' then nodes = '1'
end
cfgdata = readln('cfg')
end
close ('cfg')
numnodes = length(nodes)
trim = left(trim,1)
gfx = left(gfx,1)
if right(limit,1) ~= '/' then limit = limit||'/'
limit = limit||' '
datetot = date('basedate')
n = 0
do while pos('/',limit) > 0
n = n + 1
psn = pos('/',limit)
limit.n = left(limit,psn-1)
limit = substr(limit,psn+1)
dateset.n = datetot - limit.n
end
return